<div id="right-bar">
    <p><?php 
            if($this->Session->read('Auth.User')){
            echo $this->Html->link('Sair', array('controller'=>'usuarios','action'=>'logout'));
            ?></p>
	<b>Entregadores</b>
	<div id="entregas-content">
<!--		<span class="count">1</span><span class="entregue">Elias</span><br>
		<span class="count">2</span><span class="transito">Joyvis</span><br>
		<span class="count">3</span><span class="entregue">Carlos</span><br>
		<span class="count">4</span><span class="atrasado">Gibão Vida Loka</span><br>
		<span class="count">5</span><span class="entregue">Rafael</span><br>
		<span class="count">6</span><span class="transito">Carlos</span><br>-->
                <?php 
                //print_r()
                
                    $mod = ClassRegistry::init('Usuario');
                    $user = $mod->find('all');
                    //print_r($user);
                ?>
            <ul class='ul_view_col'>
                <?php foreach ($user as $u):?>
                <?php 
                $at = $u['Atendimento'];
                $ocupado = true;
                foreach($at as $a){
                    if($a['ic_ativo_atendimento_sim_nao']==true){
                        $ocupado= false;
                    }
                }
                ?>
                <li class='<?php  echo ($ocupado?'cred':'cblue') ?>' ><?php echo $u['Usuario']['nm_usuario'] ?></li>
                <?php endforeach;
                }?>
            </ul>
	</div>
</div>